package com.example.springboottest.controller;

import com.example.split.service.ISplitService;
import com.example.springboottest.config.ApiOperation;
import com.example.springboottest.config.OperationType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class HelloController {

    @Resource
    private ISplitService splitService;

    @OperationType("select")
    @ApiOperation(value = "查询",produces = "application/json")
    @PostMapping("/hello")
    public String getImage(@RequestParam("content") String content){
        System.out.println(content);
        if (null == splitService) {
            return "hello world";
        }
        List<String> split = splitService.split(content);
        System.out.println("返回值");
        return split.get(0) + "hello world";
    }
}
